<?php

namespace App\Miya\Models;

use App\Miya\Traits\Scope\OrderByIdTrait;
use Illuminate\Database\Eloquent\Model;

class BannerGroup extends Model
{
    use OrderByIdTrait;

    protected $guarded = [];

    public function banners()
    {
        return $this->hasMany(Banner::class, 'banner_group_id');
    }

    public function getImageListAttribute()
    {
        return $this->banners()->pluck('image');
    }
}
